xend: pass-through: report attach errors from device model
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 4 Jun 2009 09:37:39 +0000 (10:37 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 4 Jun 2009 09:37:39 +0000 (10:37 +0100)
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Cc: Edwin Zhai <edwin.zhai@intel.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
tools/python/xen/xend/XendDomainInfo.py

index b4e6e49cf51bb8871a1b2cb9717297a454e021d3..b1befd72677e124615fe8869de830b25a9b1cf08 100644 (file)
@@ -752,6 +752,12 @@ class XendDomainInfo:
 
             vslot = xstransact.Read("/local/domain/0/device-model/%i/parameter"
                                     % self.getDomid())
+            try:
+                vslot_int = int(vslot, 16)
+            except ValueError:
+                raise VmError(("Cannot pass-through PCI function '%s'. " +
+                               "Device model reported an error: %s") %
+                              (bdf_str, vslot))
         else:
             vslot = new_dev['vslot']